def is_perfect_square(n):
    if n < 0:
        return False
    import math
    square_root = math.sqrt(n)
    if square_root == int(square_root):
        return True
    else:
        return False
    
print(is_perfect_square(-9))